package demo.generics;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
import java.util.HashSet;
import java.util.List;

public class GenericsDemo {
	
	
	public static void main(String[] args) {
		
		  HashSet<String> hashSet=new HashSet<String>();
		  
		  
		   hashSet.add("hi");
		   HashSet<Integer> hashSetIntegers=new HashSet<Integer>();
		   hashSetIntegers.add(1);
		   MyCustomSet<Integer> myCustomSet=new MyCustomSet<Integer>();
		   GenericMethodDemo  demo=new GenericMethodDemo();   
		  // demo.hello(10 );
		//System.out.println(demo);
		ArrayList<Integer> arr=new ArrayList<Integer>();
		ArrayList<Double> ardr=new ArrayList<Double>();
		List < ? extends  Number> ls= arr;
		ls=ardr;
		ls.add(null);  /// get priciple. .. 
 		//ls.add(2);
		  //quizzicle phrase or wild card  rule .. 
		
		//Collection<E>     Collection<? extends Number> --> ArrayList<Number> , LinkedList<Number> 
		//ArrayList<Integer>
		// <? super Integer>
	    //arr.addAll()
//		
	//	new GenericsDemo().ba(ls);
	  //Collections.copy(dest, src);
	
	}
	
	 public void ab(List<? extends Number> ls){
		 //get principle 
		 
		Number number=    ls.get(1);
		
		for (Number number1 : ls) {
			
		}
		 
		   ls.add(null);
		 
	 }

	 public void ba(List< ? super Integer>ls){
		 //put priciple
		 ls.add(2);
		 
		
	 }
}
